package com.tensquare.user.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tensquare.user.pojo.TbUser;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.context.annotation.Configuration;

/**
 * 用户(TbUser)表数据库访问层
 *
 * @author long
 * @since 2021-07-16 17:00:06
 */
@Configuration("userDao")
public interface TbUserDao extends BaseMapper<TbUser> {
//
//    @Select("select * from tb_user where username = #{name} and is_delete=0")
//    TbUser selectByName(@Param("name") String username);

    @Select("select * from tb_user where account = #{account} and is_delete = 0")
    TbUser selectByAccess(@Param("account") String account);

    TbUser selectUserInfo(String id);

    @Update("update tb_user set is_delete = 1 where id in(#{ids})")
    int delUsers(@Param("ids") String ids);

}
